package abc.hd.com.sersiona.sersiona;

import abc.hd.com.dao.daouser;
import abc.hd.com.entity.bookes;
import abc.hd.com.entity.bookuser;
import abc.hd.com.sersiona.aer;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class aerimpl implements aer {
    @Autowired
    private daouser az;
/**
*@Author hd
*@Date 2021/11/20 14:45
*@Description  登录验证
*/
    @Override
    public bookuser getonedata(String name, String mm) {
        bookuser getdataone = az.getdataone (name, mm);
        if (getdataone!=null) {
            return getdataone;
        }
       return null;
    }
/**
*@Author hd
*@Date 2021/11/20 14:45
*@Description  分页展示
*/
    @Override
    public PageInfo<bookes> queryall(Integer page) {
        PageHelper.startPage (page,2);
        List<bookes> querydall = az.querydall ();
        PageInfo<bookes> a=new PageInfo<> (querydall);
        return a;
    }

    @Override
    public int adddata(bookuser bookuser) {
        int insertdata = az.insertdata (bookuser);
        return insertdata;
    }

    @Override
    public bookes querydata(int id) {
        bookes querydataidone = az.querydataidone (id);
        return querydataidone;
    }

    @Override
    public int updatadata(int i,int id) {
        az.updatadata(i,id);
        return 0;
    }
}
